﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

/// <summary>
/// Summary description for DonHangEntity
/// </summary>
public class DonHangEntity
{

    private string maDonHang;
    private DateTime ngayDat;
    private DateTime ngayGiao;
    private string ghiChu;
    private float tongTien;
    private string tenNguoiDat;
    private string tenNguoiNhan;
    private string diaChiNguoiNhan;
    private string dienThoaiNguoiNhan;
    private string trangThai;
    public DonHangEntity()
    { }
    public DonHangEntity(string maDonHang, DateTime ngayDat, DateTime ngayGiao, string ghiChu, float tongTien, string tenNguoiDat, string tenNguoiNhan, string diaChiNguoiNhan, string dienThoaiNguoiNhan, string trangThai)
    {
        this.maDonHang = maDonHang;
        this.ngayDat = ngayDat;
        this.ngayGiao = ngayGiao;
        this.ghiChu = ghiChu;
        this.tongTien = tongTien;
        this.tenNguoiDat = tenNguoiDat;
        this.tenNguoiNhan = tenNguoiNhan;
        this.diaChiNguoiNhan = diaChiNguoiNhan;
        this.dienThoaiNguoiNhan = dienThoaiNguoiNhan;
        this.trangThai = trangThai;
    }
    public string MaDonHang
    {
        get { return this.maDonHang; }
        set
        {
            if (value == null)
                throw new Exception("maDonHang not allow nullvalue.");
            this.maDonHang = value;
        }
    }
    public DateTime NgayDat
    {
        get { return this.ngayDat; }
        set { this.ngayDat = value; }
    }
    public DateTime NgayGiao
    {
        get { return this.ngayGiao; }
        set { this.ngayGiao = value; }
    }
    public string GhiChu
    {
        get { return this.ghiChu; }
        set { this.ghiChu = value; }
    }
    public float TongTien
    {
        get { return this.tongTien; }
        set { this.tongTien = value; }
    }
    public string TenNguoiDat
    {
        get { return this.tenNguoiDat; }
        set { this.tenNguoiDat = value; }
    }
    public string TenNguoiNhan
    {
        get { return this.tenNguoiNhan; }
        set { this.tenNguoiNhan = value; }
    }
    public string DiaChiNguoiNhan
    {
        get { return this.diaChiNguoiNhan; }
        set { this.diaChiNguoiNhan = value; }
    }
    public string DienThoaiNguoiNhan
    {
        get { return this.dienThoaiNguoiNhan; }
        set { this.dienThoaiNguoiNhan = value; }
    }
    public string TrangThai
    {
        get { return this.trangThai; }
        set { this.trangThai = value; }
    }
    public override string ToString()
    {
        return this.maDonHang + "; " + this.ngayDat + "; " + this.ngayGiao + "; " + this.ghiChu + "; " + this.tongTien + "; " + this.tenNguoiDat + "; " + this.tenNguoiNhan + "; " + this.diaChiNguoiNhan + "; " + this.dienThoaiNguoiNhan + "; " + this.trangThai + "; ";
    }
    public override bool Equals(Object obj)
    {
        DonHangEntity me = (DonHangEntity)obj;
        bool ret = this.MaDonHang.Equals(me.MaDonHang);
        return ret;
    }
    public override int GetHashCode()
    {
        return this.MaDonHang.GetHashCode();
    }

}